using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NetworkPower.Data.Models.Mapping
{
    public class SeperationMap : EntityTypeConfiguration<Seperation>
    {
        public SeperationMap()
        {
            // Primary Key
            this.HasKey(t => new { t.SeperationID, t.SeperationType, t.VoltageID });

            // Properties
            this.Property(t => t.SeperationType)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Seperations");
            this.Property(t => t.SeperationID).HasColumnName("SeperationID");
            this.Property(t => t.SeperationType).HasColumnName("SeperationType");
            this.Property(t => t.VoltageID).HasColumnName("VoltageID");
        }
    }
}
